package com.frogs.ucenter.v1.request;

import javax.servlet.http.HttpServletRequest;

import org.owasp.esapi.ESAPI;

import com.frogs.framework.util.StringUtil;
import com.frogs.framework.web.HttpRequestInfo;
import com.frogs.system.util.ApiUrlParamEnum;
import com.frogs.system.web.api.request.Request;
import com.frogs.system.web.exception.RequestIllegalException;

/**
 * 用户投诉留言
 *
 * @author wushubin
 * 
 */
public class UserFeedbackUpdateRequest extends Request{

	private static final long serialVersionUID = -2862378293178358815L;
    
	private Integer id ; 
	
	private String result;

    private Integer status = 0;
    
    private String adminName ; 
    
    private Integer adminId;
    
	public UserFeedbackUpdateRequest(){
	}
	
	@Override
	public void parse(HttpServletRequest request) {
		
		HttpRequestInfo requestInfo = new HttpRequestInfo(request);
		
		this.id = requestInfo.getIntParameter(ApiUrlParamEnum.id.getParamName(), 0);
		this.result = StringUtil.fixHtml(requestInfo.getParameter(ApiUrlParamEnum.content.getParamName(), ""));
		this.status = requestInfo.getIntParameter(ApiUrlParamEnum.status.getParamName(), 0);
		this.adminName = StringUtil.fixHtml(requestInfo.getParameter(ApiUrlParamEnum.adminName.getParamName(), ""));
		this.adminId = requestInfo.getIntParameter(ApiUrlParamEnum.adminId.getParamName(), 0);
		
		if ( StringUtil.isEmpty(result)) {
			throw new RequestIllegalException("error result!");
		}
		
		if(id < 1){
			throw new RequestIllegalException("error id!");
		}
	}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getResult() {
		return result;
	}

	public void setResult(String result) {
		this.result = result;
	}

	public Integer getStatus() {
		return status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	public String getAdminName() {
		return adminName;
	}

	public void setAdminName(String adminName) {
		this.adminName = adminName;
	}

	public Integer getAdminId() {
		return adminId;
	}

	public void setAdminId(Integer adminId) {
		this.adminId = adminId;
	}

	
	
}
